package com.lvmama.rhino.pojo.comment.Enum;

public enum EnumForWeek {

    MONDAY(1, "星期一"),

    TUESDAY(2, "星期二"),

    WEDNESDAY(3, "星期三"),

    THURSDAY(4, "星期四"),

    FRIDAY(5, "星期五"),

    SATURDAY(6, "星期六"),

    SUNDAY(7, "星期日");

    private int value;
    private String showName;

    EnumForWeek(int value, String showName) {
        this.value = value;
        this.showName = showName;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getShowName() {
        return showName;
    }

    public void setShowName(String showName) {
        this.showName = showName;
    }

    /**
     * 根据值获取名称
     *
     * @param value
     * @return
     */
    public static String getWeekShowname(int value) {
        String name = "";
        for (EnumForWeek comment : EnumForWeek.values()) {
            if (value == comment.getValue()) {
                name = comment.getShowName();
                break;
            }
        }
        return name;
    }
}
